name: tests on transformers main

on:
  push:
    branches: [main]
    paths-ignore:
        - 'docs/**'

jobs:
  tests:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Set up Python 3.11
        uses: actions/setup-python@v4
        with:
          python-version: 3.11
          cache: "pip"
          cache-dependency-path: "setup.py"
      - name: Install dependencies
        run: |
          python -m pip install --upgrade pip
          # cpu version of pytorch
          pip install -U git+https://github.com/huggingface/transformers.git
          pip install -e .[test]
      - name: Test with pytest
        run: |
          make test
